
import actions from '../action/woa';
import CONSTANT from '../constant/woa';

const woaList = [];
const currentWoa = {};

export default {
  actions,
  state: {
    woaList,
    currentWoa,
  },
  mutations: {
    [CONSTANT.WOA_GET_LIST_SUCCESS](state, list) {
      state.woaList = list;
    },
    [CONSTANT.WOA_GET_LIST_ERROR](state) {
      state.woaList = [];
    },
    [CONSTANT.WOA_SET_CURRENT_ACCOUNT](state, info) {
      state.currentWoa = Object.assign({}, state.currentWoa, info);
    },
  },
  getters: {
    [CONSTANT.WOA_GETTER_LIST](state) {
      return state.woaList;
    },
  },
};
